@use './variables' as *;

/* 去掉 tabs 组件的蓝边 */
.ant-tabs-tab:focus,
.ant-tabs-tab-btn:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* 去掉 collapse 组件的蓝边 */
.ant-collapse-header:focus,
.ant-collapse-header:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.ant-collapse-item:focus,
.ant-collapse-item:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.ant-btn {
  &.ant-btn-color-default {
    color: $text-5;
    background-color: #fff;
    border-color: $fill-2;

    &:hover {
      color: $brand-color-hover;
      border-color: $brand-color-hover;
    }

    &:active {
      color: $brand-color-active;
      border-color: $brand-color-active;
    }

    &:disabled {
      color: #000;
      background-color: $fill-2;
      border-width: 0;
    }
  }

  &.ant-btn-color-primary {
    color: $text-1;
    background: $brand-color-gradient;
    border-width: 0;

    &:hover {
      color: $text-1;
      background: linear-gradient(to right, $brand-color-hover, $brand-color-hover) !important;
      border-width: 0;
    }

    &:active {
      color: $text-1;
      background: linear-gradient(to right, $brand-color-active, $brand-color-active) !important;
      border-width: 0;
    }

    &:disabled {
      color: $text-1;
      background: linear-gradient(
        to right,
        $brand-color-disabled,
        $brand-color-disabled
      ) !important;
      border-width: 0;
    }
  }

  &.ant-btn-text {
    color: $brand-color;
    background-color: transparent;
    border-width: 0;

    &:hover {
      color: $brand-color !important;
      background-color: $fill-2 !important;
      border-width: 0;
    }

    &:active {
      color: $brand-color-active !important;
      background-color: $fill-3 !important;
      border-width: 0;
    }

    &:disabled {
      color: $brand-color-disabled !important;
      background-color: transparent !important;
      border-width: 0;
    }
  }

  &.ant-btn-link {
    height: auto;
    padding: 0;
    color: $brand-color;

    &:hover {
      color: $brand-color;
      text-decoration: underline;
    }

    &:active {
      color: $brand-color-active;
      text-decoration: underline;
    }

    &:disabled {
      color: $brand-color-disabled;
      text-decoration: none;
    }
  }

  &.ant-btn-dangerous {
    &.ant-btn-default {
      color: $error-color;
      background-color: $error-color-light; /* 危险按钮红色背景 */
      border-color: $error-color-disabled;

      &:hover {
        color: $error-color !important;
        background-color: $error-color-disabled !important;
        border-color: $error-color-hover !important;
      }

      &:active {
        color: $error-color !important;
        background-color: $error-color-disabled !important;
        border-color: $error-color !important;
      }

      &:disabled {
        color: $error-color-disabled !important;
        background-color: $error-color-light !important;
        border-width: 0 !important;
      }
    }

    &.ant-btn-text {
      color: $error-color;

      &:hover {
        color: $error-color !important;
        background-color: $fill-2 !important;
      }

      &:active {
        color: $error-color-active !important;
        background-color: $fill-3 !important;
      }

      &:disabled {
        color: $error-color-disabled !important;
        background-color: transparent !important;
      }
    }

    &.ant-btn-primary {
      color: $text-1;
      background-color: $error-color;
      border-width: 0;

      &:hover {
        background-color: $error-color-hover !important;
      }

      &:active {
        background-color: $error-color-active !important;
      }

      &:disabled {
        color: $text-1;
        background-color: $error-color-disabled !important;
      }
    }

    &.ant-btn-link {
      color: $error-color;

      &:disabled {
        color: $error-color-disabled !important;
      }
    }
  }
}

.ant-table-body {
  overflow: auto !important;
}

/* 在全局 CSS 文件中添加 */
.custom-menu {
  padding: 0 16px !important; /* 设置自定义边距 */
}

.custom-menu .ant-menu-sub .ant-menu-item {
  padding-left: 30px !important; /* 设置自定义边距 */
}

.custom-menu .anticon {
  width: 20px !important;
  height: 20px !important;
  // color: #86909C !important;
}

// .custom-menu .ant-menu-item-active  .anticon,.custom-menu  .ant-menu-submenu-active .anticon{
//   color: #222630 !important;
// }

// .custom-menu .ant-menu-item-selected .anticon {
//   color: #1B6DFA !important;
// }

.custom-menu .ant-menu-item,
.custom-menu .ant-menu-submenu-title {
  font-weight: 400; /* 默认字体粗细 */
  transition: font-weight 0.2s ease; /* 添加过渡效果 */
  padding-left: 12px !important;
  margin: 4px 0px !important;
  width: 100% !important;
}
.custom-menu .ant-menu-item .ant-menu-title-content,
.custom-menu .ant-menu-submenu-title .ant-menu-title-content {
  margin-left: 20px !important;
}

.custom-menu .ant-menu-item:hover,
.custom-menu .ant-menu-submenu-title:hover {
  font-weight: 600 !important; /* 悬浮时加粗 */
}

.custom-menu .ant-menu-item-selected,
.custom-menu .ant-menu-submenu-selected > .ant-menu-submenu-title {
  font-weight: 600 !important; /* 选中时加粗 */
}

.min-menu .ant-menu-item,
.min-menu .ant-menu-submenu-title {
  width: 40px !important;
  padding: 0 10px !important;
  margin-inline: 0 !important;
  line-height: 36px !important;
}
